package test;


import controladoresdominio.CtrlDominio;
import dominio.Node;
import dominio.Nodes;
import test.factories.NodeListFactory;
import test.factories.NodesListFactory;

import java.util.ArrayList;
import java.util.Random;

/**
 * Created by Rafael Simon Garcia on 12/16/13.
 */
public class BigDataGenerator {

    private static String[] taskNames = new String[]{
            "armchair", "armoire", "bar stool", "bassinet",
            "beach chair", "bean bag chair", "bed", "bed table",
            "bench", "bentwood rocker", "bergere", "bookcase",
            "bookshelf", "breakfront", "buffet", "bunk bed",
            "bureau", "cabinet", "canopy bed", "captain's chair",
            "card table", "carpet", "cart", "chair",
            "chaise lounge", "chandelier", "chest", "chest of drawers",
            "china cabinet", "clothes valet", "club chair", "coffee table",
            "console", "cot", "couch", "cradle",
            "credenza", "crib", "cubbies", "cupboard",
            "curio", "curtains", "cushion", "deck chair",
            "desk", "desk chair", "dining room table", "director's chair",
            "display cabinet", "divan", "drapery", "drapes",
            "dresser", "easel", "easy chair", "end table",
            "fateuil", "file cabinet", "folding chair", "folding screen",
            "footrest", "footstool", "four-poster bed", "furnishings",
            "furniture", "futon", "game table", "garden bench",
            "gateleg table", "glider rocker", "grandfather clock", "hall tree",
            "hammock", "hassock", "hat stand", "headboard",
            "highchair", "hope chest", "hutch", "island",
            "kitchen island", "ladderback chair", "lamp", "lawn chair",
            "lift chair", "light", "lintel", "lounge chair",
            "lounger", "love seat", "mantle", "mattress",
            "mirror", "Murphy bed", "nightstand",
            "office chair", "ottoman", "pantry", "park bench",
            "patio chair", "patio table", "pew", "piano bench",
            "picnic table", "pillow", "porch swing", "rack",
            "recliner", "rocking chair", "room divider", "rug",
            "sconce", "screen", "seat", "secretary",
            "sectional sofa", "settee", "shelf", "shoji screen",
            "sideboard", "sleeper sofa", "sofa", "sofabed",
            "stool", "table", "tansu", "tea cart",
            "throne", "throw rug", "trundle bed", "tuffet",
            "valet", "vanity", "Venetian blinds", "vitrine",
            "wardrobe", "waste basket", "waterbed", "window shades",
            "Windsor chair", "wing chair", "work table", "writing desk"
    };

    private static String subTaskNames[] = new String[]{
            "adjustable wrench", "ball peen hammer", "bench saw", "box end wrench",
            "brace", "C-clamp", "circular saw", "drill press", "electric drill",
            "hacksaw", "hammer", "hand drill", "handsaw",
            "locking pliers", "mallet", "open end wrench", "plane",
            "pliers", "rib joint pliers", "router", "screwdriver",
            "vise", "accelerator", "battery", "blinker",
            "brake",  "bumper", "clutch", "dashboard",
            "gear",  "headlight", "horn", "hubcap",
            "license plate",  "rearview mirror", "seat", "speedometer",
            "taillight",  "tire", "trunk",  "turn signal",
            "wheel",  "windshield", "windshield wiper", "bake",
            "boil",  "broil", "can opener", "fry",
            "grill",  "measuring cup", "measuring spoon", "microwave",
            "mixing bowl",  "paper towels", "poach",  "potholder",
            "roast", "rolling pin", "scramble", "simmer",
            "knife",  "spoon", "spatula", "steam",
            "strainer",  "timer", "fork", "acknowledgments",
            "appendix",  "bibliography", "contents", "copyright",
            "dedication",  "explanatory notes", "footnote", "index",
            "preface",  "text", "title", "boning knife",
            "bread knife",  "butcher knife", "butter knife", "cleaver",
            "filleting knife",  "grapefruit knife", "ham knife", "kitchen knife",
            "oyster knife",  "paring knife", "steak knife", "air valve",
            "baggage carrier",  "brake lever", "chain", "chain guard",
            "fender",  "front brake", "front tire", "gearshift",
            "grip",  "handlebar", "hub", "kick-stand",
            "pedal",  "rear brake", "rear tire", "rim",
            "saddle",  "spoke", "tire pump", "air filter",
            "camshaft",  "carburetor", "cooling fan", "distributor",
            "engine block",  "exhaust manifold", "fan belt", "flywheel",
            "gasoline pump",  "oil drain hole", "oil pan", "oil-level stick",
            "piston",  "spark plug cable", "starter", "back tire",
            "brake pedal",  "clutch lever", "disk brake", "drum brake",
            "engine", "gas tank", "gear shift", "inner tube",
            "muffler", "shock absorber", "spokes", "tail light",
            "baler", "combine harvester", "cultivator", "disk harrow",
            "fertilizer distributor", "harrow", "manure spreader", "ribbing plow",
            "rotary hoe", "seed drill", "subsoil plow", "tractor",
            "basin wrench", "chain pipe wrench", "monkey wrench", "pipe wrench",
            "plunger", "torch", "trap and drain auger", "tube cutter",
            "tube flaring tool", "chisel", "file", "finishing sander",
            "jigsaw", "large level", "large screwdriver", "metal snips",
            "paint brush", "pipe clamp", "portable power saw", "propane torch",
            "putty knife", "scraper", "sharpening stone", "side-cutting pliers",
            "small wrecking bar", "soldering gun", "stapler", "wire brush", "wire stripper"
    };




    public static void main(String[] args) {
        CtrlDominio controller = new CtrlDominio();
        Random r = new Random();

        for(int i = 0; i < 2000; i++){
            String tn = taskNames[r.nextInt(taskNames.length)];
            controller.crearTarea( tn + ": " + i, tn +" -----" + i);
            int subTasksAmount = r.nextInt(10);

            while(subTasksAmount == 0) subTasksAmount = r.nextInt(10);

            for(int j =0; j < subTasksAmount; j++){

                String st = subTaskNames[r.nextInt(subTaskNames.length)];
                st = st + ": " + j;
                String desc= st + " ----- " + j;
                int timeCost =r.nextInt(15);
                while(timeCost == 0) timeCost = r.nextInt(15);
                controller.guardarNuevaSubtarea(st, desc, timeCost);
                controller.anadirSubtarea(st, desc, timeCost);
            }

            controller.guardarTarea();
        }
    }
}
